uniform vec3 pos;
uniform float time;

varying float alpha;

varying float colorVar;


in  int   gl_VertexID;

void main() {
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
  colorVar = (sin(pos.x*5.0)+1.0/2.0) * (cos(pos.z*5.0)+1.0/2.0) / 12.0 + 0.90;

  alpha = 1.0-clamp(length(gl_Position.xyz) / 8.0,0.0,1.0);

  if(gl_Position.y > -1.78){
	gl_Position.x += gl_Position.x * (sin(time/1000.0)/20.0);
	gl_Position.z += gl_Position.z * (cos(time/1000.0)/20.0);
  }
}